namespace CheckoutCodeKata
{
    public class Controller
    {
        private readonly Counter _counter;
        private Items _items;

        public Controller(Counter counter, Items items)
        {
            _items = items;
            _counter = counter;
        }

        public void Add(string code)
        {
            _items.Add(code);
        }

        public void Total()
        {
            _items.CalculateTotal();
            _counter.ShowCurrentValue();
            _counter.Reset();
            _items.Reset();
        }
    }
}